package com.itheima.day13.Zuoye.Zuoye1;

public class Test {
    public static void main(String[] args) throws Exception {
            Gift x = new Gift(100);

            sendliwu s1 = new sendliwu("小红",x);
            s1.start();
        sendliwu s2 = new sendliwu("小王",x);
            s2.start();
        // 等待线程执行完毕
        s1.join();
        s2.join();

        // 输出最终统计结果
        System.out.println("小红发送了: " + x.getXiaohongCount() + " 个礼物");
        System.out.println("小王发送了: " + x.getXiaowangCount() + " 个礼物");
    }

    }
